﻿
window.ShowMessageBox = (message, title, confirm, yes, no, cancel) => {

    $('#idModalBody').html(message);
    $('#idModalTitle').html(title);
    

    var btnConfirm = $('#idConfirm')
    if (confirm) {
        btnConfirm.html(confirm);
        btnConfirm.show();
    }
    else {
        btnConfirm.hide();
    }

    var btnYes = $('#idYes')
    if (yes) {
        btnYes.html(yes);
        btnYes.show();
    }
    else {
        btnYes.hide();
    }


    var btnNo = $('#idNo')
    if (no) {
        btnNo.html(no);
        btnNo.show();
    }
    else {
        btnNo.hide();
    }

    var btnCancel = $('#idCancel')
    if (cancel) {
        btnCancel.html(cancel);
        btnCancel.show();
    }
    else {
        btnCancel.hide();
    }

    $('#idModal').modal('show');  
};

window.Toast = (title, subtitle, content, type, delay, pause_on_hover) => {
    const TYPES = ['info', 'warning', 'success', 'error'];
    $.toast({
        title: title,
        subtitle: subtitle,
        content: content,
        type: TYPES[type],
        delay: delay,
        pause_on_hover: pause_on_hover
    });
};

